package com.capgemini.edealinovaconnection.dao;

import android.database.sqlite.SQLiteDatabase;

import java.util.Map;

import de.greenrobot.dao.AbstractDao;
import de.greenrobot.dao.AbstractDaoSession;
import de.greenrobot.dao.identityscope.IdentityScopeType;
import de.greenrobot.dao.internal.DaoConfig;


import com.capgemini.edealinovaconnection.dao.Idea;
import com.capgemini.edealinovaconnection.dao.IdeaDao;
import com.capgemini.edealinovaconnection.dao.Workshop;
import com.capgemini.edealinovaconnection.dao.WorkshopDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see de.greenrobot.dao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig workshopDaoConfig;
    private final DaoConfig ideaDaoConfig;

    private final WorkshopDao workshopDao;
    private final IdeaDao ideaDao;

    public DaoSession(SQLiteDatabase db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        workshopDaoConfig = daoConfigMap.get(WorkshopDao.class).clone();
        workshopDaoConfig.initIdentityScope(type);

        ideaDaoConfig = daoConfigMap.get(IdeaDao.class).clone();
        ideaDaoConfig.initIdentityScope(type);

        workshopDao = new WorkshopDao(workshopDaoConfig, this);
        ideaDao = new IdeaDao(ideaDaoConfig, this);

        registerDao(Workshop.class, workshopDao);
        registerDao(Idea.class, ideaDao);
    }
    
    public void clear() {
        workshopDaoConfig.getIdentityScope().clear();
        ideaDaoConfig.getIdentityScope().clear();
    }

    public WorkshopDao getWorkshopDao() {
        return workshopDao;
    }

    public IdeaDao getIdeaDao() {
        return ideaDao;
    }

}
